Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make Node in named_character_references a packed struct #26

Merged
merged 1 commit into from
Aug 1, 2024

Conversation

squeek502
Copy link
Contributor

Node being a struct instead of a packed struct(u22) was a mistake left over from me testing different struct layouts when preparing #11 (whoops!). Switching back to the intended packed struct(u22) gives a free speedup and a binary size decrease (minus 7KiB for me):

Benchmark 1 (637 runs): bench-autostruct.exe
  measurement          mean ± σ            min … max           outliers         delta
  wall_time          7.85ms ±  203us    7.56ms … 11.2ms         18 ( 3%)        0%
  peak_rss           2.89MB ± 8.99KB    2.89MB … 3.12MB         39 ( 6%)        0%
Benchmark 2 (720 runs): bench-packedstructu22.exe
  measurement          mean ± σ            min … max           outliers         delta
  wall_time          6.94ms ±  177us    6.71ms … 8.80ms         36 ( 5%)        ⚡- 11.6% ±  0.3%
  peak_rss           2.88MB ± 8.46KB    2.88MB … 3.11MB         45 ( 6%)          -  0.3% ±  0.0%

Node being a `struct` instead of a `packed struct(u22)` was a mistake left over from me testing different struct layouts. Switching back to the intended `packed struct(u22)` give a free speedup and a binary size decrease (minus 7KiB):

    Benchmark 1 (637 runs): bench-autostruct.exe
      measurement          mean ± σ            min … max           outliers         delta
      wall_time          7.85ms ±  203us    7.56ms … 11.2ms         18 ( 3%)        0%
      peak_rss           2.89MB ± 8.99KB    2.89MB … 3.12MB         39 ( 6%)        0%
    Benchmark 2 (720 runs): bench-packedstructu22.exe
      measurement          mean ± σ            min … max           outliers         delta
      wall_time          6.94ms ±  177us    6.71ms … 8.80ms         36 ( 5%)        ⚡- 11.6% ±  0.3%
      peak_rss           2.88MB ± 8.46KB    2.88MB … 3.11MB         45 ( 6%)          -  0.3% ±  0.0%
@kristoff-it
Copy link
Owner

Thank you very much Ryan!

@kristoff-it kristoff-it merged commit 5bf5f90 into kristoff-it:main Aug 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants